mamedev / mame

MAME
https://www.mamedev.org/
Other
7.93k stars 1.98k forks source link

machine/8042kbdc.cpp: BeOS 3.x/4.x erratic keyboard #11977

Open angelosa opened 7 months ago

angelosa commented 7 months ago

Steps to reproduce (shortest way):

  1. grab a BeOS 3.x x86 floppy disk;
  2. mamefoo pcipc -flop1 <pathto>bootdisk.img (HDD/CD doesn't matter)
  3. Most often the "Press Space Bar for boot options" doesn't work (necessary for loading from CD), wait until it prompts you to select Boot Options;

None of the keyboard scancodes seems to match what the system expects, this is also repeated in an actual BeOS 4.0 installation, where only mouse works while keyboard gets detected with wrong & stuck keys in Keymap tool.

0254

BeOS 3.1 notes:

  1. PC=401eae cmp eax,0h, eax always 1
  2. Following snippet for the scancode interpretation (roughly enter/esc/directional arrows as also prompted by the SW):
    00413D86: 89 45 E0          mov     [ebp-20h],eax
    00413D89: 8B 45 E0          mov     eax,[ebp-20h]
    00413D8C: 2D 57 00 00 00    sub     eax,57h
    00413D91: 74 3C             je      413DCFh
    00413D93: 2D 0B 00 00 00    sub     eax,0Bh
    00413D98: 0F 84 85 00 00 00 je      413E23h
    00413D9E: 2D C4 FF FF FF    sub     eax,0FFFFFFC4h
    00413DA3: 0F 84 CA 00 00 00 je      413E73h
    00413DA9: 2D DB FF FF FF    sub     eax,0FFFFFFDBh
    00413DAE: 0F 84 31 01 00 00 je      413EE5h
    00413DB4: 2D 46 00 00 00    sub     eax,46h
    00413DB9: 0F 84 2D 01 00 00 je      413EECh
    00413DBF: 2D 14 00 00 00    sub     eax,14h
    00413DC4: 0F 84 22 01 00 00 je      413EECh
    00413DCA: E9 70 01 00 00    jmp     413F3Fh
angelosa commented 7 months ago

Related to #11797 ?