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
ussr/bk.cpp: K1801VP1-014 keyboard controller and MS7008 keyboard #12027
Conversation
m_write_virq(m_rxrdy); | ||
|
||
reset_key_state(); | ||
start_processing(attotime::from_hz(2'400)); // FIXME real device does not use polling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it work if it doesn’t scanning a key matrix? Does it have a dedicated input line per key? Does it keep all rows driven until it detects a change on a column and then scan for the row that changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand it but it looks like option 3 with extra steps (https://github.com/1801BM1/k1801/blob/master/014/ describes the process)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, interesting. When it detects the key switch connecting the row pull-up resistor to the column line, then it actively drives the column low and senses which row line gets pulled down. It then holds the state until the key is released.
It doesn’t need scanning logic at all, at the cost of not even attempting to deal with simultaneous key-presses besides the modifiers.
// save state | ||
save_item(NAME(m_key_code)); | ||
save_item(NAME(m_kbd_state)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won’t you need to save m_key_irq_vector
and m_rxrdy
as well? They seem to be live state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah -- done
src/mame/ussr/1801vp014.h
Outdated
devcb_write_line m_write_halt; | ||
devcb_write8 m_write_data; | ||
|
||
line_state m_rxrdy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line_state
is really only for things that support the HOLD_LINE
hack. It also isn’t explicitly sized and will cause an issue with save states. Just use a uint8_t
or something.
src/mame/ussr/1801vp014.cpp
Outdated
// LIVE DEVICE | ||
//************************************************************************** | ||
|
||
INPUT_PORTS_START(ms7008) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have Russian key cap labels for the letter keys as well. Also, this should be static INPUT_PORTS_START(...)
.
No description provided.