Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keypresses getting propagated from a launched program to Cesium when exiting #1

Closed
andresesevilla opened this issue Oct 13, 2015 · 11 comments

Comments

@andresesevilla
Copy link

Will capture last key press when closing programs

Ex:Open calcuzap,press clear, cesium will close.

@Eeems
Copy link

Eeems commented Oct 13, 2015

Can confirm that this happens in calcuzap. It must be something to do with how calcuzap handles the keypresses though, other programs don't cause cesium to close when pressing clear to exit.

@adriweb adriweb changed the title Bug report Keys getting propagated from a launched program to the shell when exiting Oct 13, 2015
@adriweb
Copy link
Collaborator

adriweb commented Oct 13, 2015

Might there be a way to clear the "key buffer" as soon as Cesium regains control, though?

@adriweb adriweb changed the title Keys getting propagated from a launched program to the shell when exiting Keypresses getting propagated from a launched program to Cesium when exiting Oct 13, 2015
@Eeems
Copy link

Eeems commented Oct 13, 2015

Looks like getkey is part of the main loop https://github.com/MateoConLechuga/Cesium/blob/master/src/routines/main.asm#L57
Waiting for all keys to be released before going back to the main loop might be a good idea. From what I can tell, it already is here https://github.com/MateoConLechuga/Cesium/blob/5bfb9bdd93aaf923492b4cef4d3cb371849acb6d/src/routines/common.asm#L38
It might be good to poke Patrick about how calcuzap exits to see if he's doing something strange.

@adriweb
Copy link
Collaborator

adriweb commented Oct 13, 2015

I have a fix: di before call DeletePgrmFromUserMem and ei before jp RELOADED_FROM_PRGM.
Confirmed to work with Calculzap.
Looks good?

@mateoconlechuga
Copy link
Owner

Um. If you enable interrupts, that means TIOS interrupts will be executing.
If it works, sure.

On Tue, Oct 13, 2015 at 4:52 PM, Adrien Bertrand notifications@github.com
wrote:

I have a fix: di before call DeletePgrmFromUserMem and ei before jp
RELOADED_FROM_PRGM.
Confirmed to work with Calculzap.
Looks good?


Reply to this email directly or view it on GitHub
#1 (comment)
.

@adriweb
Copy link
Collaborator

adriweb commented Oct 13, 2015

Hmm.
Well, I have pinged PatrickD on IRC, so we'll see what he thinks about his keypress handling related to that issue.

@Eeems
Copy link

Eeems commented Oct 13, 2015

You might want to just di. For all we know calcuzap enables interrupts Cesium wasn't handling them being on again properly.

EDIT: We may even want to di at ReturnHere https://github.com/MateoConLechuga/Cesium/blob/5bfb9bdd93aaf923492b4cef4d3cb371849acb6d/src/routines/reloader.asm#L44

@adriweb
Copy link
Collaborator

adriweb commented Oct 13, 2015

Yeah that looks safe enough.
I'll try that and commit soon.

@adriweb
Copy link
Collaborator

adriweb commented Oct 14, 2015

Actually, not doing ei doesn't fix the behaviour. Only di \ ... \ ei fixes it. I guess we'll have to go with that. So far, I haven't found any unexpected things with interrupts enabled at this point.
Same with a di at the ReturnHere location.

@adriweb
Copy link
Collaborator

adriweb commented Oct 14, 2015

Fixed in 1.1.2 (commit: 305c7ff)
Go redownload the binaries (8xp files) and give it a try.

Closing the issue for now.

@adriweb adriweb closed this as completed Oct 14, 2015
@Eeems
Copy link

Eeems commented Oct 15, 2015

I've just tested and can confirm that this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants