1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Corrects some deficiencies in Vic-20 keyboard mapping.

... albeit without yet being clear on the wiring behind restore.
This commit is contained in:
Thomas Harte 2017-10-12 22:33:00 -04:00
parent 78ee46270b
commit 4f289ab10b
2 changed files with 14 additions and 4 deletions

View File

@ -61,6 +61,12 @@ uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) {
BIND(Enter, KeyReturn);
BIND(Space, KeySpace);
BIND(BackSpace, KeyDelete);
BIND(Escape, KeyRunStop);
BIND(F1, KeyF1);
BIND(F3, KeyF3);
BIND(F5, KeyF5);
BIND(F7, KeyF7);
}
#undef BIND
return KeyboardMachine::Machine::KeyNotMapped;

View File

@ -111,11 +111,15 @@ class KeyboardVIA: public MOS::MOS6522::IRQDelegatePortHandler {
/// Sets whether @c key @c is_pressed.
void set_key_state(uint16_t key, bool is_pressed) {
if(key == KeyRestore) {
// TODO: how is restore wired?
} else {
if(is_pressed)
columns_[key & 7] &= ~(key >> 3);
else
columns_[key & 7] |= (key >> 3);
}
}
/// Sets all keys as unpressed.
void clear_all_keys() {