Skip to content

Update keyboard buffer on new input#135

Closed
donno2048 wants to merge 1 commit intodmsc:masterfrom
donno2048:patch-1
Closed

Update keyboard buffer on new input#135
donno2048 wants to merge 1 commit intodmsc:masterfrom
donno2048:patch-1

Conversation

@donno2048
Copy link
Copy Markdown
Contributor

Makes both #130 and #132 irrelevant while still solving the issue

@donno2048
Copy link
Copy Markdown
Contributor Author

As mentioned in #129 this also has the side effect of allowing a key combination to perform special operations to the emulator (like exiting) except in very rare edge cases

@dmsc
Copy link
Copy Markdown
Owner

dmsc commented Mar 20, 2026

This has a few problems:

  • It will loose keys if you time multiple keys in sequence before emulator update, as queued_key is set to -1.
  • Using poll is not that portable.

I will revamp keyboard handling by introducing a proper keyboard buffer, instead of "queued_key", the emulator should maintain a buffer of 16 entries in 40h:01Eh, this is what a real PC BIOS does and some programs depend on that.

At emulator_update, the keyboard should be read, keys added to the buffer and the pointer updated.

Currently, emu2 only updates the buffer pointer at 40h:01Ah.

Have Fun!

@donno2048 donno2048 closed this Mar 20, 2026
@donno2048 donno2048 deleted the patch-1 branch March 22, 2026 12:17
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.

2 participants