[Patch] Fixed XT/Tandy keyboard repeat scancode

Post Reply
User avatar
Tale
Posts: 6
Joined: Tue 13 Nov, 2018 4:00 pm
Location: The Netherlands

[Patch] Fixed XT/Tandy keyboard repeat scancode

Post by Tale » Tue 13 Nov, 2018 9:19 pm

I was looking at keyboard.c (trying to figure out why my cursor keys don't seem to work properly with the AMI XT clone), when I happened to spot an inconsistency in keyboard_process(): When a key is pressed initially it sends out scancodes from scancode_set1[], scancode_xt[], or scancode_tandy[], but when repeating it always uses scancodes from scancode_set1[]. I think this is probably an oversight, but being new to PCem I'm not 100% sure. Anyway, the attached patch #1 fixes this.

I have also attached 2 other patches, which optimize/reduce some keyboard array sizes (patch #2 takes off 39168 bytes, and #3 another 2448).
Attachments
1_xt_keyboard_repeat.patch
(1.11 KiB) Downloaded 117 times

RealNC
Posts: 16
Joined: Tue 06 Nov, 2018 3:01 am

Re: [Patch] Fixed XT/Tandy keyboard repeat scancode

Post by RealNC » Wed 14 Nov, 2018 7:46 am

Hey, this fixes keyboard input for me with 8088 emulation! When I switch to fullscreen using ctrl+alt+pgdn, the keyboard stops working. This patch seems to fix the bug and now I can finally run a fullscreen 8088 emulation.

User avatar
Tale
Posts: 6
Joined: Tue 13 Nov, 2018 4:00 pm
Location: The Netherlands

Re: [Patch] Fixed XT/Tandy keyboard repeat scancode

Post by Tale » Wed 14 Nov, 2018 6:45 pm

RealNC wrote:
Wed 14 Nov, 2018 7:46 am
Hey, this fixes keyboard input for me with 8088 emulation! When I switch to fullscreen using ctrl+alt+pgdn, the keyboard stops working. This patch seems to fix the bug and now I can finally run a fullscreen 8088 emulation.
Cool!

BTW, I just noticed that the other 2 patchs are missing, so I guess I didn't upload them (or maybe phpBB removed them while I was previewing?)... :oops: Anyway, here they are, I hope.
Attachments
3_keyboard_state_array.patch
(1.96 KiB) Downloaded 115 times
2_keyboard_scancode_array.patch
(63.76 KiB) Downloaded 118 times

User avatar
SarahWalker
Site Admin
Posts: 1726
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Fixed XT/Tandy keyboard repeat scancode

Post by SarahWalker » Tue 20 Nov, 2018 10:50 am

Merged at revs 1199 and 1200.

Post Reply