20% is not the keyboard reading, it's the total cost of the default ROM IRQ, and there are multiple reasons for that:
- it runs at 100hz, which for all intent and purpose is completely stupid, they should have used a 50hz interrupt
- it is doubly vectorized, so the ROM vector in FFFE-FFFF jumps to whatever is in page 2, so it can be redefined by the user (It's nice but costly)
- it updates internal timers, things like WAIT, blinking cursor, some sounds, ...
- it scans the entire keyboard
the main problem in fixing all that is that you can't really make changes compatible with the system, so when you start replacing the irq handler by your own, any keyboard or timer based code that calls the ROM will fail.
If you are willing to do that, the best approach is to make a disk based game, because then you can use the overlay ram and have FFFE point directly to your irq handler.
You can see an example in my CEO competition entry: http://miniserve.defence-force.org/svn/ ... Road/vbl.s
The code only handles arrow keys and space.