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

ussr/bk.cpp: K1801VP1-014 keyboard controller and MS7008 keyboard #12027

Merged
merged 4 commits into from Feb 21, 2024

Conversation

shattered
Copy link
Contributor

No description provided.

m_write_virq(m_rxrdy);

reset_key_state();
start_processing(attotime::from_hz(2'400)); // FIXME real device does not use polling
Copy link
Member

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?

Copy link
Contributor Author

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)

Copy link
Member

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.

Comment on lines +185 to +187
// save state
save_item(NAME(m_key_code));
save_item(NAME(m_kbd_state));
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah -- done

devcb_write_line m_write_halt;
devcb_write8 m_write_data;

line_state m_rxrdy;
Copy link
Member

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.

// LIVE DEVICE
//**************************************************************************

INPUT_PORTS_START(ms7008)
Copy link
Member

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(...).

@cuavas cuavas merged commit 5564654 into mamedev:master Feb 21, 2024
5 checks passed
Mokona pushed a commit to Mokona/mame that referenced this pull request Feb 28, 2024
stonedDiscord pushed a commit to stonedDiscord/mame that referenced this pull request Apr 8, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants