Closed markdryan closed 3 years ago
Here's the RiscOS documentation for the escape handler.
https://www.riscosopen.org/wiki/documentation/show/Escape%20Handler
I've pushed a fix for this to the gecko-dev branch.
Would you be able to test it for me?
(if you need me to upload a PiTubeDirect build for testing, then I can do that)
The fix looks good to me.
Would you be able to test it for me?
I can indeed. It would be great if you could upload a test build.
PiTubeDirect_20201224_1828_dmb.zip
This includes the fixed version of OS_ReadPoint
My escape handler still isn't working but looking at the code I think it's getting passed the EXIT handler's R12.
POINT(-1,-1) works fine however.
Also, escape still works in general on the *prompt and also in BASIC.
So
unsigned int r12 = env->handler[EXIT_HANDLER].r12;
should be
unsigned int r12 = env->handler[ESCAPE_HANDLER].r12;
in the two places it's used.
Sorry, that was a stupid cut/paste error
Here's another build: PiTubeDirect_20201224_2041_dmb.zip
Here's another build:
Excellent. It works! I can now escape out of my binaries without any issues. I briefly tested escape on the * prompt and in ARMBASIC and everything seems to be working. Thanks for the quick fix!
Thanks for testing this.
At least I don't think it is. I'm not quite sure how to debug this with my setup but looking at the code it doesn't seem to be passed. The escape handler wrapper seems to initialise R11, which is good, but not R12.
https://github.com/hoglet67/PiTubeDirect/blob/697b4c038fa5cb79ea98398e7da871f286642db0/src/copro-armnativeasm.S#L217-L230
The workspace pointer is however passed to the exit handler.
https://github.com/hoglet67/PiTubeDirect/blob/697b4c038fa5cb79ea98398e7da871f286642db0/src/copro-armnativeasm.S#L233-L243
https://github.com/hoglet67/PiTubeDirect/blob/697b4c038fa5cb79ea98398e7da871f286642db0/src/tube-swi.c#L809-L814
Here's my handler and registration code
When I press the escape button weird things happen. I think this is because R12 points to some random value, which the handler then writes to. I can't be absolutely sure as I can't quite figure out how to debug but looking at the PiTube direct code, the workspace pointer doesn't seem to be passed to the escape handler.