Ticket #467 (Fixed)Mon May 06 16:35:49 UTC 2019
TaskWindow not returning Escape character as per PRM 1-870
Reported by: | Richard Coleman (3190) | Severity: | Minor |
Part: | RISC OS: Module | Release: | |
Milestone: | Status | Fixed |
Details by Richard Coleman (3190):
When calling OS_Byte 129 to read a key within a time limit, the Escape key is not returning &1B in R2, as PRM 1-870 states it should.
Assembled the following code fragment in ObjAsm:
SWI OS_WriteS
DCB “Press Escape …”,0
ALIGN
MOV r0, #129
MOV r1, #&E8 ; Wait 10 seconds
MOV r2, #3
SWI OS_Byte
SWI Report_Regs ; Using Reporter to show registers and flags.
When run in a TaskWindow, pressing Escape, returns R2 = 0 and the C flag clear. R2 = 0 indicates that it has read a key within the time limit, but R1, which should hold the key character, instead = 0.
When run outside the Desktop, R2 = &1B and the C flag is set, as per PRM.
Looking at the code for the TaskWindow, the fix is to replace line 3481:
LDRB R0, EscPending
with:
LDRB R0, EscWasSet
Hacked the TaskWindow module on my ARMX6 to confirm it worked okay.
The reason EscPending is wrong as there is a BL RestoreEscape a few lines before which set EscPending to 0 and so the subsequent jump to label 35 never happens.
RestoreEscape move the value that was in EscPending into EscWasSet, which is why the change works.
Looking back through previous versions it seems this particular bit has never worked.
RISC OS Adjust 4.39 also returns R2 = 0 instead of R2 = &1B.
Have emailed amended version of Taskman to ROOL.
Changelog:
Modified by Richard Coleman (3190) Mon, June 10 2019 - 16:26:27 GMT
- Status changed from Open to Fixed
Tested okay using nightly build of Pi3 Beta ROM 2019-06-10 05:47:43