ref-xx/basinc

key presses seem to stick when querying keyboard ports with IN A,(C)

Closed this issue · 1 comments

v1.794

In assembler, when you query a keyboard port with IN A (C), the bits for the pressed keys seem to stick from one run to another.
For example if you query the keyboard row YUIOP at port 0xDFFE, initially you will get the unpressed state, that is bits 11111.
Now when you press a key, the bit for this key is set to 0, which is correct, and when you release the key, it will become 1, which is also correct.
But as soon as you return to Basic and run the assembler routine again, all keys you were using during the previous run appear to be pressed.
This happens with all keys and does not change when you CLEAR and restart your program.
The only way to get rid of this is to restart the emulator.

It's a bit difficult to describe this issue, but maybe you'll find the appropriate place in the code easily. There should be some sort of 'port reset' when running a program.

I have checked the basic related port commands and they seem to work ok. So it must be a assembler related issue which is not supported anymore. I recommend you to use a different assembler as basinC's assembler is in unfinished state.